package com.autumn.zero.workflow.entitys;

import java.util.Date;

import javax.persistence.Column;

import org.apache.ibatis.type.JdbcType;
import org.hibernate.validator.constraints.Length;

import com.autumn.domain.entities.auditing.AbstractGmtCreateEntity;
import com.autumn.mybatis.mapper.annotation.ColumnOrder;
import com.autumn.mybatis.mapper.annotation.ColumnType;
import com.autumn.mybatis.mapper.annotation.Index;

/**
 * 用户任务抽象
 * 
 * @author 杨昌国 2018-12-21 14:41:50
 */
public abstract class AbstractWorkflowUserTask extends AbstractGmtCreateEntity<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4457119000047684479L;

	/**
	 * 字段 userId
	 */
	public static final String FILED_USER_ID = "userId";

	/**
	 * 字段 taskNo
	 */
	public static final String FILED_TASK_NO = "taskNo";

	/**
	 * 字段 taskName
	 */
	public static final String FILED_TASK_NAME = "taskName";

	/**
	 * 字段 taskTime
	 */
	public static final String FILED_TASK_TIME = "taskTime";

	/**
	 * 字段 taskSummary
	 */
	public static final String FILED_TASK_SUMMARY = "taskSummary";

	/**
	 * 字段 flowProcessId
	 */
	public static final String FILED_FLOW_ID = "flowProcessId";

	/**
	 * userId 最大长度
	 */
	public static final int MAX_USER_ID_LENGTH = 64;

	/**
	 * taskNo 最大长度
	 */
	public static final int MAX_TASK_NO_LENGTH = 64;

	/**
	 * taskName 最大长度
	 */
	public static final int MAX_TASK_NAME_LENGTH = 255;

	/**
	 * taskSummary 最大长度
	 */
	public static final int MAX_TASK_SUMMARY_LENGTH = 255;

	/**
	 * 流程Id {@link AbstractWorkflowProcess ->id}
	 */
	@Column(name = "flow_process_id", nullable = false)
	@ColumnOrder(1)
	@Index
	private Long flowProcessId;

	/**
	 * 用户id
	 */
	@Length(max = MAX_USER_ID_LENGTH, message = "用户id长度不能超过" + MAX_USER_ID_LENGTH + "个字。")
	@Column(name = "user_id", nullable = false, length = MAX_USER_ID_LENGTH)
	@ColumnType(jdbcType = JdbcType.VARCHAR)
	@ColumnOrder(2)
	@Index
	private String userId;

	/**
	 * 任务编号
	 */
	@Length(max = MAX_TASK_NO_LENGTH, message = "任务编号长度不能超过" + MAX_TASK_NO_LENGTH + "个字。")
	@Column(name = "task_no", nullable = false, length = MAX_TASK_NO_LENGTH)
	@ColumnType(jdbcType = JdbcType.VARCHAR)
	@ColumnOrder(2)
	@Index
	private String taskNo;

	/**
	 * 任务名称
	 */
	@Length(max = MAX_TASK_NAME_LENGTH, message = "任务名称长度不能超过" + MAX_TASK_NAME_LENGTH + "个字。")
	@Column(name = "task_name", nullable = false, length = MAX_TASK_NAME_LENGTH)
	@ColumnType(jdbcType = JdbcType.VARCHAR)
	@ColumnOrder(3)
	private String taskName;

	/**
	 * 任务时间
	 */
	@Column(name = "task_time", nullable = false)
	@ColumnOrder(4)
	@Index
	private Date taskTime;

	/**
	 * 任务摘要
	 */
	@Length(max = MAX_TASK_SUMMARY_LENGTH, message = " 任务摘要长度不能超过" + MAX_TASK_SUMMARY_LENGTH + "个字。")
	@Column(name = "task_summary", nullable = false, length = MAX_TASK_SUMMARY_LENGTH)
	@ColumnType(jdbcType = JdbcType.VARCHAR)
	@ColumnOrder(5)
	private String taskSummary;

	/**
	 * 获取用户Id
	 * 
	 * @return
	 */
	public String getUserId() {
		return userId;
	}

	/**
	 * 设置用户id
	 * 
	 * @param userId
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}

	/**
	 * 获取任务编号
	 * 
	 * @return
	 */
	public String getTaskNo() {
		return taskNo;
	}

	/**
	 * 设置任务编号
	 * 
	 * @param taskNo
	 */
	public void setTaskNo(String taskNo) {
		this.taskNo = taskNo;
	}

	/**
	 * 获取任务名称
	 * 
	 * @return
	 */
	public String getTaskName() {
		return taskName;
	}

	/**
	 * 设置任务名称
	 * 
	 * @param taskName
	 */
	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	/**
	 * 获取任务时间
	 * 
	 * @return
	 */
	public Date getTaskTime() {
		return taskTime;
	}

	/**
	 * 设置任务时间
	 * 
	 * @param taskTime
	 */
	public void setTaskTime(Date taskTime) {
		this.taskTime = taskTime;
	}

	/**
	 * 获取任务摘要
	 * 
	 * @return
	 */
	public String getTaskSummary() {
		return taskSummary;
	}

	/**
	 * 设置任务摘要
	 * 
	 * @param taskSummary
	 */
	public void setTaskSummary(String taskSummary) {
		this.taskSummary = taskSummary;
	}

	/**
	 * 获取流程Id
	 * 
	 * @return
	 */
	public Long getFlowProcessId() {
		return flowProcessId;
	}

	/**
	 * 设置流程id
	 * 
	 * @param flowProcessId
	 */
	public void setFlowProcessId(Long flowProcessId) {
		this.flowProcessId = flowProcessId;
	}
}
